package org.springblade.tms.module.common.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.tms.global.entity.EnumSelect;
import org.springblade.tms.module.common.base.EnumService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @projectName: BladeX
 * @package: org.springblade.tms.module.common.controller
 * @className: SelectEnumController
 * @author: yr
 * @description: 查询枚举接口
 * @date: 2022/3/11 16:06
 */
@RestController
@AllArgsConstructor
@RequestMapping("common")
@Api(value = "查询枚举接口-wzq", tags = "查询枚举接口-yr")
public class SelectEnumController {

	private EnumService enumService;

	@ApiLog("查询枚举接口")
	@GetMapping("/SelectEnum")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "查询枚举接口")
	public List<EnumSelect.EnumSelectItem> SelectEnum(String name) {
		return enumService.getEnum(name).getResult();
	}
}
